home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- PRODUCT : Delphi NUMBER : 2856
- VERSION : All
- OS : Windows
- DATE : August 22, 1995 PAGE : 1/1
-
- TITLE : How to terminate all running applications
-
-
-
-
- Q: How do I terminate all running tasks?
-
- A: Below is some code that will help if you want to terminate ALL tasks,
- no questions asked.
-
- A word of caution, before you run this for the first time, make sure
- that you save it and anything else that may have some pending data.
-
-
- procedure TForm1.ButtonKillAllClick(Sender: TObject);
- var
- pTask : PTaskEntry;
- Task : Bool;
- ThisTask: THANDLE;
- begin
- GetMem (pTask, SizeOf (TTaskEntry));
- pTask^.dwSize := SizeOf (TTaskEntry);
-
- Task := TaskFirst (pTask);
- while Task do
- begin
- if pTask^.hInst = hInstance then
- ThisTask := pTask^.hTask
- else
- TerminateApp (pTask^.hTask, NO_UAE_BOX);
- Task := TaskNext (pTask);
- end;
- TerminateApp (ThisTask, NO_UAE_BOX);
- end;
-
-
-
-
-
-
-
-
-
-
-
- DISCLAIMER: You have the right to use this technical information
- subject to the terms of the No-Nonsense License Statement that
- you received with the Borland product to which this information
- pertains.
-